{extend name="common:base"/}
{block name="body"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-12">
        <h2>系统</h2>
    </div>
</div>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="panel blank-panel panel-heading background-fff">
                <div class="panel-options">
                    <ul class="nav nav-tabs">
                        <li class="active">
                            <a data-toggle="tab" href="#tab1">基础</a>
                        </li>
                        <li class="">
                            <a data-toggle="tab" href="#tab2">扩展</a>
                        </li>
                    </ul>
                </div>

                <form action="{:\\think\\Url::build('renew')}" method="post" id="signupForm" class="form-horizontal">
                    <div class="tab-content">
                        <div id="tab1" class="tab-pane active">
                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">上级分类<span class="check-tips"></span></label>
                                <input  class="form-control input-large" type="text" disabled="disabled" value="{$category.title|default='无'}">
                            </div>

                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">分类名称<span class="check-tips">(名称不能为空)</span></label>
                                <input  class="form-control input-large" type="text" name="title" value="{$info.title|default=''}">
                            </div>

                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">分类标识<span class="check-tips">(英文字母)</span></label>
                                <input  class="form-control input-large" type="text" name="name" value="{$info.name|default=''}">
                            </div>
                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">分组定义<span class="check-tips"></span></label>
                                <textarea name="groups" class="form-control input-large" rows="4">{$info.groups|default=''}</textarea>
                            </div>
                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">发布内容<span class="check-tips">(是否允许发布内容)</span></label>
                                <div class="radio">
                                    <label><input type="radio" name="allow_publish"  value="0" > 不允许</label>
                                    <label><input type="radio" name="allow_publish"  value="1" checked> 仅允许后台</label>
                                    <label><input type="radio" name="allow_publish"  value="2" > 允许前后台</label>
                                </div>
                            </div>
                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">是否审核<span class="check-tips">(在该分类下发布的内容是否需要审核)</span></label>
                                <div class="radio">
                                    <label><input type="radio" name="check"  value="0" checked> 不需要</label>
                                    <label><input type="radio" name="check"  value="1" > 需要</label>
                                </div>
                            </div>
                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">允许文档类型<span class="check-tips"></span></label>
                                <div class="checkbox">
                                    {volist name=":\think\Config::get('document_model_type')" id="type"}
                                    <label><input type="checkbox" name="type[]" value="{$key}">{$type}</label>
                                    {/volist}
                                </div>
                            </div>
                            <div class="m-b-sm m-t-sm inline">
                                <label class=" control-label">分类图标<span class="check-tips"></span></label>
                                {include file="category:category_pic" /}
                            </div>
                        </div>
                        <div id="tab2" class="tab-pane">
                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">可见性<span class="check-tips">(是否对用户可见，针对前台)</span></label>
                                <select class="form-control input-3x" name="display">
                                    <option value="1">所有人可见</option>
                                    <option value="0">不可见</option>
                                    <option value="2">管理员可见</option>
                                </select>
                            </div>

                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">排序<span class="check-tips">(仅对当前层级分类有效)</span></label>
                                <input  class="form-control input-small" type="text" name="sort" value="{$info.sort|default=0}">
                            </div>
                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">列表行数<span class="check-tips"></span></label>
                                <input  class="form-control input-large" type="text" name="list_row" value="{$info.list_row|default=''}">
                            </div>
                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">网页标题<span class="check-tips"></span></label>
                                <input  class="form-control input-large" type="text" name="meta_title" value="{$info.meta_title|default=''}">
                            </div>
                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">关键字<span class="check-tips">(用英文逗号隔开)</span></label>
                                <textarea name="keywords" class="form-control input-large" rows="4">{$info.keywords|default=''}</textarea>
                            </div>
                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">描述<span class="check-tips"></span></label>
                                <textarea name="description" class="form-control input-large" rows="4">{$info.description|default=''}</textarea>
                            </div>


                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">频道模板<span class="check-tips"></span></label>
                                <input  class="form-control input-large" type="text" name="template_index" value="{$info.template_index|default=''}">
                            </div>
                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">列表模板<span class="check-tips"></span></label>
                                <input  class="form-control input-large" type="text" name="template_lists" value="{$info.template_lists|default=''}">
                            </div>
                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">详情模板<span class="check-tips"></span></label>
                                <input  class="form-control input-large" type="text" name="template_lists" value="{$info.template_detail|default=''}">
                            </div>
                            <div class="m-b-sm m-t-sm">
                                <label class=" control-label">编辑模板<span class="check-tips"></span></label>
                                <input  class="form-control input-large" type="text" name="template_edit" value="{$info.template_edit|default=''}">
                            </div>
                        </div>

                        <div class="m-b-sm m-t-sm">
                            <input type="hidden" name="id" value="{$info.id|default=''}">
                            <input type="hidden" name="pid" value="{$category['id']??''}">
                            <input type="hidden" name="level" value="{$info.id?$category.level:$category.level+1}">
                            <button class="btn btn-w-m btn-primary" type="submit">提交</button>
                            <button class="btn btn-w-m btn-default retreat">取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="css"}
<link href="__STATIC__/uploadify/Huploadify.css" rel="stylesheet" type="text/css">
<link href="__STATIC__/fancyBox/jquery.fancybox.css" rel="stylesheet" type="text/css">
{/block}
{block name="script"}
<script type="text/javascript" src="__JS__/detail.js"></script>
<script type="text/javascript" src="__JS__/plugins/validate/jquery.validate.min.js"></script>
<script type="text/javascript" src="__JS__/plugins/validate/messages_zh.min.js"></script>
<script type="text/javascript" src="__STATIC__/uploadify/Huploadify.js"></script>
<script type="text/javascript" src="__STATIC__/fancyBox/jquery.fancybox.pack.js"></script>
<script type="text/javascript" src="__STATIC__/fancyBox/jquery.fancybox-media.js"></script>
<script type="text/javascript">
    {present name="info.id"}
    static7.setChoose("allow_publish", "{$info.allow_publish|default=1}");
    static7.setChoose("check", "{$info.check|default=0}");
    static7.setChoose("type[]", {$info.type|explode = ',',###|json_encode}||[2]);
    static7.setChoose("model[]", {$info.model|explode = ',',###|json_encode}||'');
    static7.setChoose("display", "{$info.display|default = 1}");
    {/present}
    highlight_subnav("{:\\think\\Url::build('Category/index')}");
    $("#signupForm").validate({
    rules: {
        name: {
            required: true,
            minlength: 2
        },title: "required"
        },messages: {
            name: {
            required: '配置名称不能为空',
                    minlength: '至少两个字符以上'
            },
            title: {
                required: "标题不能为空"
                }
            },
            submitHandler: function () {
            validateAjax("#signupForm", "button[type='submit']");
            return false;
        }
    });
</script>
{/block}